from django import forms
from django.forms import ModelForm
from .models import UserExtension

class RegisterForm(forms.ModelForm):
    name= forms.CharField(
            label='用户名',
            required=True,
            max_length=128 ,
            error_messages={'required':'忘记写名字啦！','max_length':'给爷爬！',}
        )
    password= forms.CharField(
            label='密码',
            required=True,
            min_length=3 ,
            max_length=30 ,
            error_messages={
                'required':'忘记输密码啦！',
                'max_length':'给爷爬！',
                'min_length':'太短了，多整点吧',
                }
        )
    #password = password1
    class Meta:
        model = UserExtension
        fields = ['password','name','qqnumber','email','url','picurl']
